﻿<%@ WebHandler Language="C#" Class="Handler" %>

using System;
using System.Web;

public class Handler : IHttpHandler {
    
    public void ProcessRequest (HttpContext context) {
        context.Response.ContentType = "text/plain";

        HttpPostedFile file1 = HttpContext.Current.Request.Files["MobileCamera"];

        Random rd = new Random();
        int i=rd.Next(1, 100);

        string path = HttpContext.Current.Server.MapPath("~\\") + i.ToString() + ".jpg";
        
        file1.SaveAs(path);
       
    }
 
    public bool IsReusable {
        get {
            return false;
        }
    }

}